package com.hospital.post.feign;

import com.hospital.common.base.Result;
import com.hospital.common.config.FeignConfig;
import com.hospital.common.dto.search.module.PostInsertDto;
import com.hospital.common.dto.search.module.ReplyInsertDto;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "search-module",configuration = FeignConfig.class)
public interface ESFeign
{
    /**
     * 插入帖子到ES中
     */
    @PostMapping("/elastic/insertPost")
    Result<?> insertPost(@Valid @RequestBody PostInsertDto insertDto);
    /**
     * 插入回复到ES中
     */
    @PostMapping("/elastic/insertReply")
    Result<?> insertReply(@Valid @RequestBody ReplyInsertDto insertDto);

}
